<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li class="active" ng-bind="title"></li>
    </ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <form ng-submit="searchRe()" class="form-horizontal">
                <div class="form-group">
                    <div class="col-sm-2">
                        <input type="text" class="form-control" ng-model="param.menuName" id="menuName"
                               placeholder="菜单名称">
                    </div>
                    <div class="col-sm-2">
                        <select class="form-control" ng-model="param.menuType" id="menuType" ng-change="changeMenuType()">
                            <option value="1" ng-selected="1">一级菜单</option>
                            <option value="2">二级菜单</option>
                        </select>
                    </div>
                    <div class="col-sm-2" id="menuBox">
                        <select class="form-control" ng-model="param.parentId"
                                ng-options="d.id as d.menuName for d in parentList" id="parentId" ng-change="changeParent()">
                            <option value="">--上级菜单--</option>
                        </select>
                    </div>
                    <div class="col-md-1">
                        <label class="col-sm-1 control-label"><button class="ifc-btn btn-primary"  type="submit">查 询</button></label>
                    </div>
                    <div class="col-md-1">
                        <label class="col-sm-1 control-label"><button class="ifc-btn btn-dark" ng-click="clearSearch()" type="reset">清 空</button></label>
                    </div>
                    <div class="col-md-1">
                        <label class="col-sm-1 control-label"><button type="button" ui-sref="main.sys.menu.create" class="ifc-btn btn-success"  >添加菜单</button></label>
                    </div>
                    <div class="col-md-1">
                        <label class="col-sm-1 control-label" >
                            <button type="button"  class="ifc-btn btn-success editSortBtn" ng-click="editSort($event)" >拖拽排序</button>
                            <button type="button"  style="display: none" class="ifc-btn btn-success saveSortBtn" ng-click="saveSort($event)" >保存</button>
                        </label>
                    </div>
                </div>
            </form>

            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center sort" >
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>菜单名称</th>
                        <th>节点图标</th>
                        <th>菜单地址</th>
                        <th id="sortId">排序号</th>
                        <th>菜单类型</th>
                        <th>上级菜单</th>
                        <th>权限标识</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="menuList">
                    <tr ng-repeat="item in pageInfo.records">
                        <td class="v-middle">{{$index + 1}}</td>
                        <td class="v-middle" style="display: none">{{item.id}}</td>
                        <td class="v-middle" >{{item.menuName}}</td>
                        <td class="v-middle" >
                            <i class="{{item.iconcls}}" style="font-size: 22px"></i>
                        </td>
                        <td class="v-middle">{{item.request}}</td>
                        <td class="v-middle">{{item.sortNo}}</td>
                        <td class="v-middle" style="display:none;"><input type="tel" style="width:40px" value = "{{item.sortNo}}"/></td>
                        <td class="v-middle">{{item.menuType==1?'一级菜单':'二级菜单'}}</td>
                        <td class="v-middle">{{item.parentIdText}}</td>
                        <td class="v-middle">{{item.permission}}</td>
                        <td class="v-middle">
                            <a ui-sref="main.sys.menu.menubtnlist({id: item.id})" ng-if="item.menuType!=1" class="btn btn-sm btn-default">
                            <i class="fa fa-edit m-r-xs text-sm"></i>按钮设置</a>
                            <a ui-sref="main.sys.menu.update({id: item.id})" class="btn btn-sm btn-default">
                                <i class="fa fa-edit m-r-xs text-sm"></i>编辑</a>
                            <button type="button" ng-show="item.usable==1"  ng-click="disableItem(item.id,0)" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-ban m-r-xs text-sm"></i>删除</button>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div><!-- /.table-responsive -->

            <!-- 底部分页 -->
			<span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div><!-- /.panel -->
    </div><!-- /.wrapper-data -->

</div><!-- /.wrapper-md -->